package com.whaleread.flutter.plugin.adnet_qq;

import android.content.Context;

import java.util.Map;

import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MessageCodec;
import io.flutter.plugin.common.StandardMessageCodec;
import io.flutter.plugin.platform.PlatformView;
import io.flutter.plugin.platform.PlatformViewFactory;

/// 原文链接：https://blog.csdn.net/tly599167/article/details/105785397
public class SplashViewFactory extends PlatformViewFactory {

    private final BinaryMessenger messenger;
//    private final Context context;

    SplashViewFactory(BinaryMessenger messenger) {
        super(StandardMessageCodec.INSTANCE);
        this.messenger = messenger;
    }

    @Override
    public PlatformView create(Context context, int viewId, Object args) {
        Map<String, Object> params = (Map<String, Object>) args;
        /// [args]是由Flutter传过来的自定义参数
        return new SplashAd(context, messenger, viewId, params);
    }

}
